package com.beasts.ant.page.repository;

import com.beasts.ant.page.entity.APGroupPage;
import com.beasts.ant.page.entity.Layout;
import com.beasts.ant.page.entity.RemindMessage;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author cn_zkn
 * @date 20/04/2018 11:04 AM
 * @since 1.0
 */
public interface MessageRepository extends JpaRepository<RemindMessage, String> {


    @Transactional
    @Modifying
    @Query("update RemindMessage am set am.status = ?1 where am.eventCode = ?2 and am.userId= ?3 and am.appId= ?4")
    public void updateMessage(String status , String eventCode, String userId, String appId );

    List<RemindMessage> findByStatusOrderByBusiDateDesc(String status);

}
